table of contents
| LWRES_PACKET(3) | BIND9 | LWRES_PACKET(3) |
NAME¶
lwres_lwpacket_renderheader, lwres_lwpacket_parseheader - lightweight resolver packet handling functions
SYNOPSIS¶
#include <lwres/lwpacket.h>
lwres_result_t lwres_lwpacket_renderheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt);
lwres_result_t lwres_lwpacket_parseheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt);
DESCRIPTION¶
These functions rely on a struct lwres_lwpacket which is defined in lwres/lwpacket.h.
typedef struct lwres_lwpacket lwres_lwpacket_t;
struct lwres_lwpacket {
lwres_uint32_t length;
lwres_uint16_t version;
lwres_uint16_t pktflags;
lwres_uint32_t serial;
lwres_uint32_t opcode;
lwres_uint32_t result;
lwres_uint32_t recvlength;
lwres_uint16_t authtype;
lwres_uint16_t authlength;
};
The elements of this structure are:
length
version
pktflags
serial
opcode
result
recvlength
authtype
authlen
The following opcodes are currently defined:
NOOP
GETADDRSBYNAME
GETNAMEBYADDR
lwres_lwpacket_renderheader() transfers the contents of lightweight resolver packet structure lwres_lwpacket_t*pkt in network byte order to the lightweight resolver buffer, *b.
lwres_lwpacket_parseheader() performs the converse operation. It transfers data in network byte order from buffer *b to resolver packet *pkt. The contents of the buffer b should correspond to a lwres_lwpacket_t.
RETURN VALUES¶
Successful calls to lwres_lwpacket_renderheader() and lwres_lwpacket_parseheader() return LWRES_R_SUCCESS. If there is insufficient space to copy data between the buffer *b and lightweight resolver packet *pkt both functions return LWRES_R_UNEXPECTEDEND.
AUTHOR¶
Internet Systems Consortium, Inc.
COPYRIGHT¶
Copyright © 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
| 2007-06-18 | ISC |